load spamData.mat;
Xmean = mean(Xtrain);
Xstd = std(Xtrain);
Xstandard = Xtrain;

for rowIndex=1:size(Xstandard,1)
    for colIndex=1:size(Xstandard,2)
        Xstandard(rowIndex,colIndex) = (Xstandard(rowIndex,colIndex) - Xmean(colIndex))/Xstd(colIndex);
    end
end


Xmean = mean(Xtest);
Xstd = std(Xtest);
XstandardTest = Xtest;

for rowIndex=1:size(XstandardTest,1)
    for colIndex=1:size(XstandardTest,2)
        XstandardTest(rowIndex,colIndex) = (XstandardTest(rowIndex,colIndex) - Xmean(colIndex))/Xstd(colIndex);
    end
end


alpha = 0.001;
epsilon = 10;

[trainErrorNormalize,testErrorNormalize] = logisticRegression(Xstandard,ytrain, XstandardTest, ytest, alpha, epsilon)

